﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Topcoder
{
    namespace SRM144
    {
        class Time
        {
            public string whatTime(int input)
            {
                return (input / 3600) + ":" + ((input % 3600) / 60) + ":" + input % 60;
            }
        }

        class BinaryCode
        {
            public static string[] decode(string input)
            {
                int len = input.Length;
                int[] a = new int[len];
                int[] b = new int[len];
                string[] result = new string[2];

                for (int i = 0; i < len; i++)
                    a[i] = (int)(input[i] - '0');

                for (int j = 0; j < 2; j++)
                {
                    b[0] = j;
                    int n = 0;
                    for (int i = 1; i < len; i++)
                    {
                        n = i - 2;
                        b[i] = a[i - 1] - b[i - 1];
                        if (n >= 0) b[i] = b[i] - b[n];
                    }
                    result[j] = "";
                    int k = (len > 1 ? b[len - 2] : 0);
                    if (b[len - 1] + k != a[len - 1]) result[j] = "NONE";
                    else
                    {
                        for (int i = 0; i < len; i++)
                        {
                            if ((b[i] != 0) && (b[i] != 1)) { result[j] = "NONE"; break; }
                            result[j] += b[i].ToString();
                        }
                    }
                }

                return result;
            }
        }
    }
}
